-- CALC_BISHOP_ATTACK

-- 计算主教攻击
return function(bishop)
    local attack;

    local dungeonId = DungeonM.getDungeonId();
    if dungeonId == 20023 then
        attack = 20;
    elseif dungeonId == 20022 then
        attack = 15;
    else
        attack = 10;
    end

    -- 1. 绝对值加成
    local prop = PropM.combine(bishop, "attrib2", "attack");
    attack = PropM.apply(prop, attack);

    -- 2. 百分比加成
    prop = PropM.combine(bishop, "attrib", "attack");
    attack = PropM.apply(prop, attack);

    -- 玩家对召唤兽属性加成
    local addon_attack = FormulaM.invoke("SUMMON_ATTRIB_ADDITION", bishop, attack, "attack");

    -- 所有召唤物能力加
    prop = PropM.combine(ME.user, "summon_attrib", "attack");
    attack = PropM.apply(prop, attack);

    return attack + addon_attack;
end
